var validatorName2 = function(rule, value, callback) {
  var reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/
  if (value === '') {
    callback(new Error('请输入薪资'))
  } else if (!reg.test(value)) {
    callback(new Error('请输入数字'))
  } else if (value < 0) {
    callback(new Error('薪资不能小于0'))
  } else {
    callback()
  }
}
const validate = {
  name1: [
    {
      required: true,
      message: '请输入任务名称',
      trigger: 'change'
    }
  ],
  name2: [{ validator: validatorName2 }],
  name3: [{ validator: validatorName2 }],
  name4: [
    {
      required: true,
      message: '请选择薪资范围',
      trigger: 'change'
    }
  ],
  name5: [
    {
      required: true,
      message: '请选择用工周期',
      trigger: 'change'
    }
  ],
  name6: [
    {
      required: true,
      message: '请选择性别要求',
      trigger: 'change'
    }
  ],
  name7: [
    {
      required: true,
      message: '请选择学历要求',
      trigger: 'change'
    }
  ],
  name8: [
    {
      required: true,
      message: '请选择年龄',
      trigger: 'change'
    }
  ],
  name9: [
    {
      required: true,
      message: '请选择年龄',
      trigger: 'change'
    }
  ],
  name10: [
    {
      required: true,
      message: '请选择工作地点',
      trigger: 'change'
    }
  ],
  name11: [
    {
      required: true,
      message: '请输入工作内容(10~200字)',
      trigger: 'change'
    },
    { min: 10, max: 200, message: '工作内容10-200个字', trigger: 'change' }
  ]
}
export default validate
